# rsyslog-kmsg - feed /proc/kmsg into rsyslog
#
# This service is used to feed output from /proc/kmsg into rsyslog so
# it does not need to be privileged.

description	"feed /proc/kmsg into rsyslog"

start on starting rsyslog
stop on stopped rsyslog

respawn

pre-start script
    mkdir -p /var/run/rsyslog
    chown syslog:syslog /var/run/rsyslog

    [ -e /var/run/rsyslog/kmsg ] || mkfifo -m 600 /var/run/rsyslog/kmsg
    chown syslog:syslog /var/run/rsyslog/kmsg
end script

exec dd bs=1 if=/proc/kmsg of=/var/run/rsyslog/kmsg

post-stop script
    rm /var/run/rsyslog/kmsg
end script
